import "./App.css";
import axios from "axios";

import React, { Component } from "react";

export default class App extends Component {
  getStudentData = () => {
    axios.get("http://localhost:3000/api1/students").then((res) => {
      console.log(res);
    });
  };

  getCateData = () => {
    axios.get("http://localhost:3000/api2/cars").then((res) => {
      console.log(res);
    });
  };
  render() {
    return (
      <div>
        <button onClick={this.getStudentData}>请求学生信息</button>
        <button onClick={this.getCateData}>请求汽车信息</button>
      </div>
    );
  }
}
